package at.ac.lbg.media.vis.client.theme.view
{
	import flare.vis.data.NodeSprite;
	
	import mx.collections.ArrayCollection;
	
	public class Artwork extends NodeSprite {
		
		public var id:Number;
		public var title:String;
		public var origX:Number;
		public var origY:Number;
		public var stackCount:int;
		public var categoryIds:ArrayCollection = new ArrayCollection();
		private var _highlightMe:Number = -1;
		
		public function Artwork(obj:Object) { 
			super();
			id = obj.id;
			title = obj.title;
			if (title.length > 25) {
				title = title.substr(0, 20).concat("...");
			}
			origX = obj.x;
			origY = obj.y;
			stackCount = obj.stackCount;
			var cats:ArrayCollection = obj.categories;
			for (var i:int = 0; i < cats.length; i++) {
				categoryIds.addItem(cats[i].id);
			}

		}
		
		public function set highlightMe(n:Number):void {
			if (n != this._highlightMe) {
				this._highlightMe = n;
				dirty();
			}
		}
		
		public function get highlightMe():Number {
			return _highlightMe;
		}
		
	}
}